@import '../../styles/theme.less';

.error-logs-container {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 30%, #16213e 70%, #0f3460 100%);
  font-family: @font-family;
  
  // 动态背景效果
  .logs-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    
    .particles {
      position: absolute;
      width: 100%;
      height: 100%;
      background-image: 
        radial-gradient(2px 2px at 20px 30px, @accent-color, transparent),
        radial-gradient(2px 2px at 40px 70px, @primary-color, transparent),
        radial-gradient(1px 1px at 90px 40px, @success-color, transparent),
        radial-gradient(1px 1px at 130px 80px, @warning-color, transparent),
        radial-gradient(2px 2px at 160px 30px, @accent-color, transparent),
        radial-gradient(1px 1px at 200px 60px, @secondary-color, transparent);
      background-repeat: repeat;
      background-size: 300px 200px;
      animation: particles 25s linear infinite;
      opacity: 0.6;
    }
    
    .grid-overlay {
      position: absolute;
      width: 100%;
      height: 100%;
      background-image: 
        linear-gradient(rgba(102, 126, 234, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.08) 1px, transparent 1px);
      background-size: 60px 60px;
      animation: grid-move 15s linear infinite;
    }
  }
  
  // 页面内容容器
  .logs-content {
    position: relative;
    z-index: 1;
    padding: @spacing-lg;
  }
  
  .logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: @spacing-lg;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: @radius-xl;
    padding: @spacing-lg;
    
    .header-left {
      display: flex;
      align-items: center;
      gap: @spacing-md;
      
      h1 {
        font-size: @text-3xl;
        font-weight: 700;
        margin: 0;
        color: rgba(255, 255, 255, 0.9);
        background: linear-gradient(135deg, @accent-color 0%, @primary-color 50%, @success-color 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
    }
    
    .header-actions {
      display: flex;
      gap: @spacing-sm;
      
      .ant-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
        border-radius: @radius-lg;
        transition: @transition-bounce;
        
        &:hover {
          background: rgba(255, 255, 255, 0.1);
          border-color: rgba(102, 126, 234, 0.5);
          color: white;
          box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
        }
        
        &.ant-btn-primary {
          background: @bg-gradient;
          border: none;
          color: white;
          
          &:hover {
            transform: translateY(-2px);
            box-shadow: @shadow-glow;
          }
        }
      }
    }
  }
  
  .main-tabs {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: @radius-xl;
    overflow: hidden;
    
    .ant-tabs-nav {
      background: rgba(255, 255, 255, 0.05);
      margin: 0;
      padding: 0 @spacing-lg;
      
      .ant-tabs-tab {
        color: rgba(255, 255, 255, 0.6);
        border: none;
        
        &:hover {
          color: rgba(255, 255, 255, 0.8);
        }
        
        &.ant-tabs-tab-active {
          color: white;
          background: rgba(102, 126, 234, 0.2);
          border-radius: @radius-md @radius-md 0 0;
          
          .ant-tabs-tab-btn {
            color: white;
          }
        }
      }
      
      .ant-tabs-ink-bar {
        background: @bg-gradient;
        height: 3px;
      }
    }
    
    .ant-tabs-content-holder {
      background: transparent;
      
      .ant-tabs-content {
        padding: @spacing-lg;
      }
    }
  }
  
  // 仪表板样式
  .dashboard-container {
    .stats-cards {
      .ant-card {
        background: rgba(255, 255, 255, 0.03);
        backdrop-filter: blur(25px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: @radius-xl;
        transition: @transition-bounce;
        position: relative;
        overflow: hidden;
        
        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          height: 3px;
          background: @bg-gradient;
        }
        
        &:hover {
          transform: translateY(-4px);
          box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15);
          border-color: rgba(102, 126, 234, 0.3);
        }
        
        .ant-card-body {
          background: transparent;
        }
        
        .ant-statistic {
          .ant-statistic-title {
            color: rgba(255, 255, 255, 0.6);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
          }
          
          .ant-statistic-content {
            .ant-statistic-content-value {
              color: white;
              font-weight: 700;
            }
          }
        }
      }
    }
  }
  
  // 过滤器样式
  .filters-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: @radius-xl;
    margin-bottom: @spacing-md;
    transition: @transition-bounce;
    
    &:hover {
      border-color: rgba(102, 126, 234, 0.3);
    }
    
    .ant-card-body {
      padding: @spacing-md @spacing-lg;
      background: transparent;
    }
    
    .ant-select,
    .ant-input,
    .ant-picker {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.8);
      border-radius: @radius-md;
      
      &:hover {
        border-color: rgba(102, 126, 234, 0.5);
      }
      
      &:focus,
      &.ant-select-focused {
        border-color: @primary-color;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
      }
    }
    
    .ant-select-selector {
      background: transparent !important;
      color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .ant-select-selection-placeholder {
      color: rgba(255, 255, 255, 0.4) !important;
    }
  }
  
  // 表格样式
  .logs-table-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: @radius-xl;
    transition: @transition-bounce;
    
    &:hover {
      border-color: rgba(102, 126, 234, 0.3);
    }
    
    .ant-card-body {
      background: transparent;
    }
    
    .ant-table {
      background: transparent;
      
      .ant-table-thead > tr > th {
        background: rgba(255, 255, 255, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
        font-weight: 600;
      }
      
      .ant-table-tbody > tr {
        background: transparent;
        
        &:hover > td {
          background: rgba(102, 126, 234, 0.1) !important;
        }
        
        > td {
          border-bottom: 1px solid rgba(255, 255, 255, 0.05);
          color: rgba(255, 255, 255, 0.8);
        }
      }
      
      .timestamp-cell {
        display: flex;
        align-items: center;
        font-family: @font-mono;
        font-size: @text-xs;
        color: rgba(255, 255, 255, 0.6);
      }
      
      .error-message {
        color: rgba(255, 255, 255, 0.9);
        font-weight: 500;
      }
      
      .source-text {
        background: rgba(102, 126, 234, 0.2);
        color: rgba(255, 255, 255, 0.9);
        font-size: @text-xs;
        padding: @spacing-xs @spacing-sm;
        border-radius: @radius-sm;
        border: 1px solid rgba(102, 126, 234, 0.3);
      }
    }
    
    .ant-pagination {
      .ant-pagination-item {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        
        a {
          color: rgba(255, 255, 255, 0.8);
        }
        
        &:hover {
          border-color: @primary-color;
        }
        
        &.ant-pagination-item-active {
          background: @bg-gradient;
          border-color: @primary-color;
          
          a {
            color: white;
          }
        }
      }
      
      .ant-pagination-prev,
      .ant-pagination-next {
        .ant-pagination-item-link {
          background: rgba(255, 255, 255, 0.05);
          border: 1px solid rgba(255, 255, 255, 0.1);
          color: rgba(255, 255, 255, 0.8);
          
          &:hover {
            border-color: @primary-color;
            color: white;
          }
        }
      }
    }
  }
  
  // 详情抽屉样式
  .log-detail {
    .detail-section {
      .detail-item {
        margin-bottom: @spacing-lg;
        
        strong {
          display: block;
          margin-bottom: @spacing-sm;
          color: rgba(255, 255, 255, 0.9);
          font-weight: 600;
          font-size: @text-base;
        }
        
        .stack-trace {
          background: rgba(0, 0, 0, 0.6);
          color: rgba(255, 255, 255, 0.9);
          border: 1px solid rgba(255, 255, 255, 0.1);
          border-radius: @radius-md;
          padding: @spacing-md;
          font-family: @font-mono;
          font-size: @text-xs;
          line-height: 1.6;
          white-space: pre-wrap;
          word-break: break-all;
          max-height: 400px;
          overflow-y: auto;
        }
      }
    }
  }
  
  // 用户行为追踪样式
  .user-behavior {
    .breadcrumb-item {
      background: rgba(255, 255, 255, 0.03);
      backdrop-filter: blur(25px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: @radius-lg;
      padding: @spacing-md;
      margin-bottom: @spacing-sm;
      transition: @transition-bounce;
      
      &:hover {
        border-color: rgba(102, 126, 234, 0.3);
        transform: translateY(-2px);
      }
      
      .breadcrumb-header {
        display: flex;
        align-items: center;
        gap: @spacing-sm;
        margin-bottom: @spacing-xs;
        
        .anticon {
          color: @primary-color;
        }
        
        .breadcrumb-time {
          color: rgba(255, 255, 255, 0.6);
          font-size: @text-xs;
          font-family: @font-mono;
        }
        
        .breadcrumb-category {
          color: rgba(255, 255, 255, 0.8);
          font-weight: 500;
        }
      }
      
      .breadcrumb-message {
        color: rgba(255, 255, 255, 0.7);
        font-size: @text-sm;
      }
    }
  }
  
  // 告警配置样式
  .alert-config {
    .ant-card {
      background: rgba(255, 255, 255, 0.03);
      backdrop-filter: blur(25px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: @radius-xl;
      transition: @transition-bounce;
      
      &:hover {
        border-color: rgba(102, 126, 234, 0.3);
      }
      
      .ant-card-body {
        background: transparent;
      }
    }
  }
}

// 动画定义
@keyframes particles {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(-300px) translateY(-200px);
  }
}

@keyframes grid-move {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(60px, 60px);
  }
}

// 抽屉样式覆盖
.ant-drawer {
  .ant-drawer-content {
    background: rgba(15, 52, 96, 0.95);
    backdrop-filter: blur(25px);
  }
  
  .ant-drawer-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    .ant-drawer-title {
      color: rgba(255, 255, 255, 0.9);
      font-weight: 600;
    }
  }
  
  .ant-drawer-body {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
  }
}

// 模态框样式覆盖
.ant-modal {
  .ant-modal-content {
    background: rgba(15, 52, 96, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .ant-modal-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    .ant-modal-title {
      color: rgba(255, 255, 255, 0.9);
      font-weight: 600;
    }
  }
  
  .ant-modal-body {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .error-logs-container {
    .logs-content {
      padding: @spacing-md;
    }
    
    .logs-header {
      flex-direction: column;
      gap: @spacing-md;
      align-items: flex-start;
      
      .header-actions {
        width: 100%;
        justify-content: flex-end;
      }
    }
    
    .filters-card .ant-row {
      .ant-col {
        margin-bottom: @spacing-sm;
      }
    }
    
    .dashboard-container {
      .stats-cards {
        .ant-col {
          margin-bottom: @spacing-md;
        }
      }
    }
  }
}